import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
    // vue异步组件技术 ==== 异步加载(一个组件生成一个js文件)
    {
        path: "/score",
        name: "score",
        component: resolve => require(['@views/score'], resolve) // vue-router配置路由 使用vue的异步组件技术,实现按需加载,一个组件生成一个js文件

    },
    {
        path: "/clearStorage",
        name: "clearStorage",
        component: resolve => require(['@views/clearStorage'], resolve) // vue-router配置路由 使用vue的异步组件技术,实现按需加载,一个组件生成一个js文件
    },
    {
        path: "/personList",
        name: "personList",
        component: resolve => require(['@views/personList'], resolve) // vue-router配置路由 使用vue的异步组件技术,实现按需加载,一个组件生成一个js文件

    },
    {
        path: "/scoreList",
        name: "scoreList",
        component: resolve => require(['@views/scoreList'], resolve) // vue-router配置路由 使用vue的异步组件技术,实现按需加载,一个组件生成一个js文件

    },
    {
        path: "/",
        name: "theme",
        component: resolve => require(['@views/theme'], resolve) // vue-router配置路由 使用vue的异步组件技术,实现按需加载,一个组件生成一个js文件
    },
];

const router = new VueRouter({
    routes,
});

export default router;
